(0) Obligation:

Clauses:

merge([], X, X).
merge(X, [], X).
merge(.(X, Xs), .(Y, Ys), .(X, Zs)) :- ','(leq(X, Y), merge(Xs, .(Y, Ys), Zs)).
merge(.(X, Xs), .(Y, Ys), .(Y, Zs)) :- ','(less(Y, X), merge(.(X, Xs), Ys, Zs)).
less(0, s(0)).
less(s(X), s(Y)) :- less(X, Y).
leq(0, 0).
leq(0, s(0)).
leq(s(X), s(Y)) :- leq(X, Y).

Query: merge(g,g,a)

(1) PrologToDTProblemTransformerProof (SOUND transformation)

Built DT problem from termination graph DT10.

(2) Obligation:

Triples:

leqB(s(X1), s(X2)) :- leqB(X1, X2).
lessC(s(X1), s(X2)) :- lessC(X1, X2).
mergeA(.(0, X1), .(0, X2), .(0, X3)) :- mergeA(X1, .(0, X2), X3).
mergeA(.(0, X1), .(s(0), X2), .(0, X3)) :- mergeA(X1, .(s(0), X2), X3).
mergeA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) :- leqB(X1, X3).
mergeA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) :- ','(leqcB(X1, X3), mergeA(X2, .(s(X3), X4), X5)).
mergeA(.(X1, X2), .(X3, X4), .(X3, X5)) :- lessC(X3, X1).
mergeA(.(X1, X2), .(X3, X4), .(X3, X5)) :- ','(lesscC(X3, X1), mergeA(.(X1, X2), X4, X5)).
mergeA(.(s(0), X1), .(0, X2), .(0, X3)) :- mergeA(.(s(0), X1), X2, X3).
mergeA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) :- lessC(X3, X1).
mergeA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) :- ','(lesscC(X3, X1), mergeA(.(s(X1), X2), X4, X5)).

Clauses:

mergecA([], X1, X1).
mergecA([], [], []).
mergecA(X1, [], X1).
mergecA(.(0, X1), .(0, X2), .(0, X3)) :- mergecA(X1, .(0, X2), X3).
mergecA(.(0, X1), .(s(0), X2), .(0, X3)) :- mergecA(X1, .(s(0), X2), X3).
mergecA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) :- ','(leqcB(X1, X3), mergecA(X2, .(s(X3), X4), X5)).
mergecA(.(X1, X2), .(X3, X4), .(X3, X5)) :- ','(lesscC(X3, X1), mergecA(.(X1, X2), X4, X5)).
mergecA(.(s(0), X1), .(0, X2), .(0, X3)) :- mergecA(.(s(0), X1), X2, X3).
mergecA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) :- ','(lesscC(X3, X1), mergecA(.(s(X1), X2), X4, X5)).
leqcB(0, 0).
leqcB(0, s(0)).
leqcB(s(X1), s(X2)) :- leqcB(X1, X2).
lesscC(0, s(0)).
lesscC(s(X1), s(X2)) :- lesscC(X1, X2).

Afs:

mergeA(x1, x2, x3)  =  mergeA(x1, x2)

(3) TriplesToPiDPProof (SOUND transformation)

We use the technique of [DT09]. With regard to the inferred argument filtering the predicates were used in the following modes:
mergeA_in: (b,b,f)
leqB_in: (b,b)
leqcB_in: (b,b)
lessC_in: (b,b)
lesscC_in: (b,b)
Transforming TRIPLES into the following Term Rewriting System:
Pi DP problem:
The TRS P consists of the following rules:

MERGEA_IN_GGA(.(0, X1), .(0, X2), .(0, X3)) → U3_GGA(X1, X2, X3, mergeA_in_gga(X1, .(0, X2), X3))
MERGEA_IN_GGA(.(0, X1), .(0, X2), .(0, X3)) → MERGEA_IN_GGA(X1, .(0, X2), X3)
MERGEA_IN_GGA(.(0, X1), .(s(0), X2), .(0, X3)) → U4_GGA(X1, X2, X3, mergeA_in_gga(X1, .(s(0), X2), X3))
MERGEA_IN_GGA(.(0, X1), .(s(0), X2), .(0, X3)) → MERGEA_IN_GGA(X1, .(s(0), X2), X3)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → U5_GGA(X1, X2, X3, X4, X5, leqB_in_gg(X1, X3))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → LEQB_IN_GG(X1, X3)
LEQB_IN_GG(s(X1), s(X2)) → U1_GG(X1, X2, leqB_in_gg(X1, X2))
LEQB_IN_GG(s(X1), s(X2)) → LEQB_IN_GG(X1, X2)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → U6_GGA(X1, X2, X3, X4, X5, leqcB_in_gg(X1, X3))
U6_GGA(X1, X2, X3, X4, X5, leqcB_out_gg(X1, X3)) → U7_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(X2, .(s(X3), X4), X5))
U6_GGA(X1, X2, X3, X4, X5, leqcB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4), X5)
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → U8_GGA(X1, X2, X3, X4, X5, lessC_in_gg(X3, X1))
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → LESSC_IN_GG(X3, X1)
LESSC_IN_GG(s(X1), s(X2)) → U2_GG(X1, X2, lessC_in_gg(X1, X2))
LESSC_IN_GG(s(X1), s(X2)) → LESSC_IN_GG(X1, X2)
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → U9_GGA(X1, X2, X3, X4, X5, lesscC_in_gg(X3, X1))
U9_GGA(X1, X2, X3, X4, X5, lesscC_out_gg(X3, X1)) → U10_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(.(X1, X2), X4, X5))
U9_GGA(X1, X2, X3, X4, X5, lesscC_out_gg(X3, X1)) → MERGEA_IN_GGA(.(X1, X2), X4, X5)
MERGEA_IN_GGA(.(s(0), X1), .(0, X2), .(0, X3)) → U11_GGA(X1, X2, X3, mergeA_in_gga(.(s(0), X1), X2, X3))
MERGEA_IN_GGA(.(s(0), X1), .(0, X2), .(0, X3)) → MERGEA_IN_GGA(.(s(0), X1), X2, X3)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → U12_GGA(X1, X2, X3, X4, X5, lessC_in_gg(X3, X1))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → LESSC_IN_GG(X3, X1)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → U13_GGA(X1, X2, X3, X4, X5, lesscC_in_gg(X3, X1))
U13_GGA(X1, X2, X3, X4, X5, lesscC_out_gg(X3, X1)) → U14_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(.(s(X1), X2), X4, X5))
U13_GGA(X1, X2, X3, X4, X5, lesscC_out_gg(X3, X1)) → MERGEA_IN_GGA(.(s(X1), X2), X4, X5)

The TRS R consists of the following rules:

leqcB_in_gg(0, 0) → leqcB_out_gg(0, 0)
leqcB_in_gg(0, s(0)) → leqcB_out_gg(0, s(0))
leqcB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, leqcB_in_gg(X1, X2))
U25_gg(X1, X2, leqcB_out_gg(X1, X2)) → leqcB_out_gg(s(X1), s(X2))
lesscC_in_gg(0, s(0)) → lesscC_out_gg(0, s(0))
lesscC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, lesscC_in_gg(X1, X2))
U26_gg(X1, X2, lesscC_out_gg(X1, X2)) → lesscC_out_gg(s(X1), s(X2))

The argument filtering Pi contains the following mapping:
mergeA_in_gga(x1, x2, x3)  =  mergeA_in_gga(x1, x2)
.(x1, x2)  =  .(x1, x2)
0  =  0
s(x1)  =  s(x1)
leqB_in_gg(x1, x2)  =  leqB_in_gg(x1, x2)
leqcB_in_gg(x1, x2)  =  leqcB_in_gg(x1, x2)
leqcB_out_gg(x1, x2)  =  leqcB_out_gg(x1, x2)
U25_gg(x1, x2, x3)  =  U25_gg(x1, x2, x3)
lessC_in_gg(x1, x2)  =  lessC_in_gg(x1, x2)
lesscC_in_gg(x1, x2)  =  lesscC_in_gg(x1, x2)
lesscC_out_gg(x1, x2)  =  lesscC_out_gg(x1, x2)
U26_gg(x1, x2, x3)  =  U26_gg(x1, x2, x3)
MERGEA_IN_GGA(x1, x2, x3)  =  MERGEA_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x4, x6)
LEQB_IN_GG(x1, x2)  =  LEQB_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x2, x3)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
U7_GGA(x1, x2, x3, x4, x5, x6)  =  U7_GGA(x1, x2, x3, x4, x6)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)
LESSC_IN_GG(x1, x2)  =  LESSC_IN_GG(x1, x2)
U2_GG(x1, x2, x3)  =  U2_GG(x1, x2, x3)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
U10_GGA(x1, x2, x3, x4, x5, x6)  =  U10_GGA(x1, x2, x3, x4, x6)
U11_GGA(x1, x2, x3, x4)  =  U11_GGA(x1, x2, x4)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x1, x2, x3, x4, x6)
U13_GGA(x1, x2, x3, x4, x5, x6)  =  U13_GGA(x1, x2, x3, x4, x6)
U14_GGA(x1, x2, x3, x4, x5, x6)  =  U14_GGA(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains

Infinitary Constructor Rewriting Termination of PiDP implies Termination of TRIPLES

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MERGEA_IN_GGA(.(0, X1), .(0, X2), .(0, X3)) → U3_GGA(X1, X2, X3, mergeA_in_gga(X1, .(0, X2), X3))
MERGEA_IN_GGA(.(0, X1), .(0, X2), .(0, X3)) → MERGEA_IN_GGA(X1, .(0, X2), X3)
MERGEA_IN_GGA(.(0, X1), .(s(0), X2), .(0, X3)) → U4_GGA(X1, X2, X3, mergeA_in_gga(X1, .(s(0), X2), X3))
MERGEA_IN_GGA(.(0, X1), .(s(0), X2), .(0, X3)) → MERGEA_IN_GGA(X1, .(s(0), X2), X3)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → U5_GGA(X1, X2, X3, X4, X5, leqB_in_gg(X1, X3))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → LEQB_IN_GG(X1, X3)
LEQB_IN_GG(s(X1), s(X2)) → U1_GG(X1, X2, leqB_in_gg(X1, X2))
LEQB_IN_GG(s(X1), s(X2)) → LEQB_IN_GG(X1, X2)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → U6_GGA(X1, X2, X3, X4, X5, leqcB_in_gg(X1, X3))
U6_GGA(X1, X2, X3, X4, X5, leqcB_out_gg(X1, X3)) → U7_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(X2, .(s(X3), X4), X5))
U6_GGA(X1, X2, X3, X4, X5, leqcB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4), X5)
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → U8_GGA(X1, X2, X3, X4, X5, lessC_in_gg(X3, X1))
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → LESSC_IN_GG(X3, X1)
LESSC_IN_GG(s(X1), s(X2)) → U2_GG(X1, X2, lessC_in_gg(X1, X2))
LESSC_IN_GG(s(X1), s(X2)) → LESSC_IN_GG(X1, X2)
MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → U9_GGA(X1, X2, X3, X4, X5, lesscC_in_gg(X3, X1))
U9_GGA(X1, X2, X3, X4, X5, lesscC_out_gg(X3, X1)) → U10_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(.(X1, X2), X4, X5))
U9_GGA(X1, X2, X3, X4, X5, lesscC_out_gg(X3, X1)) → MERGEA_IN_GGA(.(X1, X2), X4, X5)
MERGEA_IN_GGA(.(s(0), X1), .(0, X2), .(0, X3)) → U11_GGA(X1, X2, X3, mergeA_in_gga(.(s(0), X1), X2, X3))
MERGEA_IN_GGA(.(s(0), X1), .(0, X2), .(0, X3)) → MERGEA_IN_GGA(.(s(0), X1), X2, X3)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → U12_GGA(X1, X2, X3, X4, X5, lessC_in_gg(X3, X1))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → LESSC_IN_GG(X3, X1)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → U13_GGA(X1, X2, X3, X4, X5, lesscC_in_gg(X3, X1))
U13_GGA(X1, X2, X3, X4, X5, lesscC_out_gg(X3, X1)) → U14_GGA(X1, X2, X3, X4, X5, mergeA_in_gga(.(s(X1), X2), X4, X5))
U13_GGA(X1, X2, X3, X4, X5, lesscC_out_gg(X3, X1)) → MERGEA_IN_GGA(.(s(X1), X2), X4, X5)

The TRS R consists of the following rules:

leqcB_in_gg(0, 0) → leqcB_out_gg(0, 0)
leqcB_in_gg(0, s(0)) → leqcB_out_gg(0, s(0))
leqcB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, leqcB_in_gg(X1, X2))
U25_gg(X1, X2, leqcB_out_gg(X1, X2)) → leqcB_out_gg(s(X1), s(X2))
lesscC_in_gg(0, s(0)) → lesscC_out_gg(0, s(0))
lesscC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, lesscC_in_gg(X1, X2))
U26_gg(X1, X2, lesscC_out_gg(X1, X2)) → lesscC_out_gg(s(X1), s(X2))

The argument filtering Pi contains the following mapping:
mergeA_in_gga(x1, x2, x3)  =  mergeA_in_gga(x1, x2)
.(x1, x2)  =  .(x1, x2)
0  =  0
s(x1)  =  s(x1)
leqB_in_gg(x1, x2)  =  leqB_in_gg(x1, x2)
leqcB_in_gg(x1, x2)  =  leqcB_in_gg(x1, x2)
leqcB_out_gg(x1, x2)  =  leqcB_out_gg(x1, x2)
U25_gg(x1, x2, x3)  =  U25_gg(x1, x2, x3)
lessC_in_gg(x1, x2)  =  lessC_in_gg(x1, x2)
lesscC_in_gg(x1, x2)  =  lesscC_in_gg(x1, x2)
lesscC_out_gg(x1, x2)  =  lesscC_out_gg(x1, x2)
U26_gg(x1, x2, x3)  =  U26_gg(x1, x2, x3)
MERGEA_IN_GGA(x1, x2, x3)  =  MERGEA_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x1, x2, x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x1, x2, x4)
U5_GGA(x1, x2, x3, x4, x5, x6)  =  U5_GGA(x1, x2, x3, x4, x6)
LEQB_IN_GG(x1, x2)  =  LEQB_IN_GG(x1, x2)
U1_GG(x1, x2, x3)  =  U1_GG(x1, x2, x3)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
U7_GGA(x1, x2, x3, x4, x5, x6)  =  U7_GGA(x1, x2, x3, x4, x6)
U8_GGA(x1, x2, x3, x4, x5, x6)  =  U8_GGA(x1, x2, x3, x4, x6)
LESSC_IN_GG(x1, x2)  =  LESSC_IN_GG(x1, x2)
U2_GG(x1, x2, x3)  =  U2_GG(x1, x2, x3)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
U10_GGA(x1, x2, x3, x4, x5, x6)  =  U10_GGA(x1, x2, x3, x4, x6)
U11_GGA(x1, x2, x3, x4)  =  U11_GGA(x1, x2, x4)
U12_GGA(x1, x2, x3, x4, x5, x6)  =  U12_GGA(x1, x2, x3, x4, x6)
U13_GGA(x1, x2, x3, x4, x5, x6)  =  U13_GGA(x1, x2, x3, x4, x6)
U14_GGA(x1, x2, x3, x4, x5, x6)  =  U14_GGA(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 3 SCCs with 14 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSC_IN_GG(s(X1), s(X2)) → LESSC_IN_GG(X1, X2)

The TRS R consists of the following rules:

leqcB_in_gg(0, 0) → leqcB_out_gg(0, 0)
leqcB_in_gg(0, s(0)) → leqcB_out_gg(0, s(0))
leqcB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, leqcB_in_gg(X1, X2))
U25_gg(X1, X2, leqcB_out_gg(X1, X2)) → leqcB_out_gg(s(X1), s(X2))
lesscC_in_gg(0, s(0)) → lesscC_out_gg(0, s(0))
lesscC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, lesscC_in_gg(X1, X2))
U26_gg(X1, X2, lesscC_out_gg(X1, X2)) → lesscC_out_gg(s(X1), s(X2))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LESSC_IN_GG(s(X1), s(X2)) → LESSC_IN_GG(X1, X2)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(10) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LESSC_IN_GG(s(X1), s(X2)) → LESSC_IN_GG(X1, X2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • LESSC_IN_GG(s(X1), s(X2)) → LESSC_IN_GG(X1, X2)
    The graph contains the following edges 1 > 1, 2 > 2

(13) YES

(14) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LEQB_IN_GG(s(X1), s(X2)) → LEQB_IN_GG(X1, X2)

The TRS R consists of the following rules:

leqcB_in_gg(0, 0) → leqcB_out_gg(0, 0)
leqcB_in_gg(0, s(0)) → leqcB_out_gg(0, s(0))
leqcB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, leqcB_in_gg(X1, X2))
U25_gg(X1, X2, leqcB_out_gg(X1, X2)) → leqcB_out_gg(s(X1), s(X2))
lesscC_in_gg(0, s(0)) → lesscC_out_gg(0, s(0))
lesscC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, lesscC_in_gg(X1, X2))
U26_gg(X1, X2, lesscC_out_gg(X1, X2)) → lesscC_out_gg(s(X1), s(X2))

Pi is empty.
We have to consider all (P,R,Pi)-chains

(15) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

LEQB_IN_GG(s(X1), s(X2)) → LEQB_IN_GG(X1, X2)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains

(17) PiDPToQDPProof (EQUIVALENT transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

LEQB_IN_GG(s(X1), s(X2)) → LEQB_IN_GG(X1, X2)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(19) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • LEQB_IN_GG(s(X1), s(X2)) → LEQB_IN_GG(X1, X2)
    The graph contains the following edges 1 > 1, 2 > 2

(20) YES

(21) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MERGEA_IN_GGA(.(X1, X2), .(X3, X4), .(X3, X5)) → U9_GGA(X1, X2, X3, X4, X5, lesscC_in_gg(X3, X1))
U9_GGA(X1, X2, X3, X4, X5, lesscC_out_gg(X3, X1)) → MERGEA_IN_GGA(.(X1, X2), X4, X5)
MERGEA_IN_GGA(.(0, X1), .(0, X2), .(0, X3)) → MERGEA_IN_GGA(X1, .(0, X2), X3)
MERGEA_IN_GGA(.(s(0), X1), .(0, X2), .(0, X3)) → MERGEA_IN_GGA(.(s(0), X1), X2, X3)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X1), X5)) → U6_GGA(X1, X2, X3, X4, X5, leqcB_in_gg(X1, X3))
U6_GGA(X1, X2, X3, X4, X5, leqcB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4), X5)
MERGEA_IN_GGA(.(0, X1), .(s(0), X2), .(0, X3)) → MERGEA_IN_GGA(X1, .(s(0), X2), X3)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4), .(s(X3), X5)) → U13_GGA(X1, X2, X3, X4, X5, lesscC_in_gg(X3, X1))
U13_GGA(X1, X2, X3, X4, X5, lesscC_out_gg(X3, X1)) → MERGEA_IN_GGA(.(s(X1), X2), X4, X5)

The TRS R consists of the following rules:

leqcB_in_gg(0, 0) → leqcB_out_gg(0, 0)
leqcB_in_gg(0, s(0)) → leqcB_out_gg(0, s(0))
leqcB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, leqcB_in_gg(X1, X2))
U25_gg(X1, X2, leqcB_out_gg(X1, X2)) → leqcB_out_gg(s(X1), s(X2))
lesscC_in_gg(0, s(0)) → lesscC_out_gg(0, s(0))
lesscC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, lesscC_in_gg(X1, X2))
U26_gg(X1, X2, lesscC_out_gg(X1, X2)) → lesscC_out_gg(s(X1), s(X2))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
0  =  0
s(x1)  =  s(x1)
leqcB_in_gg(x1, x2)  =  leqcB_in_gg(x1, x2)
leqcB_out_gg(x1, x2)  =  leqcB_out_gg(x1, x2)
U25_gg(x1, x2, x3)  =  U25_gg(x1, x2, x3)
lesscC_in_gg(x1, x2)  =  lesscC_in_gg(x1, x2)
lesscC_out_gg(x1, x2)  =  lesscC_out_gg(x1, x2)
U26_gg(x1, x2, x3)  =  U26_gg(x1, x2, x3)
MERGEA_IN_GGA(x1, x2, x3)  =  MERGEA_IN_GGA(x1, x2)
U6_GGA(x1, x2, x3, x4, x5, x6)  =  U6_GGA(x1, x2, x3, x4, x6)
U9_GGA(x1, x2, x3, x4, x5, x6)  =  U9_GGA(x1, x2, x3, x4, x6)
U13_GGA(x1, x2, x3, x4, x5, x6)  =  U13_GGA(x1, x2, x3, x4, x6)

We have to consider all (P,R,Pi)-chains

(22) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(23) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MERGEA_IN_GGA(.(X1, X2), .(X3, X4)) → U9_GGA(X1, X2, X3, X4, lesscC_in_gg(X3, X1))
U9_GGA(X1, X2, X3, X4, lesscC_out_gg(X3, X1)) → MERGEA_IN_GGA(.(X1, X2), X4)
MERGEA_IN_GGA(.(0, X1), .(0, X2)) → MERGEA_IN_GGA(X1, .(0, X2))
MERGEA_IN_GGA(.(s(0), X1), .(0, X2)) → MERGEA_IN_GGA(.(s(0), X1), X2)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U6_GGA(X1, X2, X3, X4, leqcB_in_gg(X1, X3))
U6_GGA(X1, X2, X3, X4, leqcB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4))
MERGEA_IN_GGA(.(0, X1), .(s(0), X2)) → MERGEA_IN_GGA(X1, .(s(0), X2))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U13_GGA(X1, X2, X3, X4, lesscC_in_gg(X3, X1))
U13_GGA(X1, X2, X3, X4, lesscC_out_gg(X3, X1)) → MERGEA_IN_GGA(.(s(X1), X2), X4)

The TRS R consists of the following rules:

leqcB_in_gg(0, 0) → leqcB_out_gg(0, 0)
leqcB_in_gg(0, s(0)) → leqcB_out_gg(0, s(0))
leqcB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, leqcB_in_gg(X1, X2))
U25_gg(X1, X2, leqcB_out_gg(X1, X2)) → leqcB_out_gg(s(X1), s(X2))
lesscC_in_gg(0, s(0)) → lesscC_out_gg(0, s(0))
lesscC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, lesscC_in_gg(X1, X2))
U26_gg(X1, X2, lesscC_out_gg(X1, X2)) → lesscC_out_gg(s(X1), s(X2))

The set Q consists of the following terms:

leqcB_in_gg(x0, x1)
U25_gg(x0, x1, x2)
lesscC_in_gg(x0, x1)
U26_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(24) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

MERGEA_IN_GGA(.(X1, X2), .(X3, X4)) → U9_GGA(X1, X2, X3, X4, lesscC_in_gg(X3, X1))
MERGEA_IN_GGA(.(0, X1), .(0, X2)) → MERGEA_IN_GGA(X1, .(0, X2))
MERGEA_IN_GGA(.(s(0), X1), .(0, X2)) → MERGEA_IN_GGA(.(s(0), X1), X2)
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U6_GGA(X1, X2, X3, X4, leqcB_in_gg(X1, X3))
U6_GGA(X1, X2, X3, X4, leqcB_out_gg(X1, X3)) → MERGEA_IN_GGA(X2, .(s(X3), X4))
MERGEA_IN_GGA(.(0, X1), .(s(0), X2)) → MERGEA_IN_GGA(X1, .(s(0), X2))
MERGEA_IN_GGA(.(s(X1), X2), .(s(X3), X4)) → U13_GGA(X1, X2, X3, X4, lesscC_in_gg(X3, X1))
U13_GGA(X1, X2, X3, X4, lesscC_out_gg(X3, X1)) → MERGEA_IN_GGA(.(s(X1), X2), X4)


Used ordering: Polynomial interpretation [POLO]:

POL(.(x1, x2)) = 2 + x1 + x2   
POL(0) = 0   
POL(MERGEA_IN_GGA(x1, x2)) = 2·x1 + 2·x2   
POL(U13_GGA(x1, x2, x3, x4, x5)) = 1 + 2·x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5   
POL(U25_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U26_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U6_GGA(x1, x2, x3, x4, x5)) = 1 + 2·x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5   
POL(U9_GGA(x1, x2, x3, x4, x5)) = 2 + x1 + 2·x2 + x3 + 2·x4 + x5   
POL(leqcB_in_gg(x1, x2)) = 2 + x1 + x2   
POL(leqcB_out_gg(x1, x2)) = 2 + x1 + x2   
POL(lesscC_in_gg(x1, x2)) = 2 + x1 + x2   
POL(lesscC_out_gg(x1, x2)) = 2 + x1 + x2   
POL(s(x1)) = 2·x1   

(25) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U9_GGA(X1, X2, X3, X4, lesscC_out_gg(X3, X1)) → MERGEA_IN_GGA(.(X1, X2), X4)

The TRS R consists of the following rules:

leqcB_in_gg(0, 0) → leqcB_out_gg(0, 0)
leqcB_in_gg(0, s(0)) → leqcB_out_gg(0, s(0))
leqcB_in_gg(s(X1), s(X2)) → U25_gg(X1, X2, leqcB_in_gg(X1, X2))
U25_gg(X1, X2, leqcB_out_gg(X1, X2)) → leqcB_out_gg(s(X1), s(X2))
lesscC_in_gg(0, s(0)) → lesscC_out_gg(0, s(0))
lesscC_in_gg(s(X1), s(X2)) → U26_gg(X1, X2, lesscC_in_gg(X1, X2))
U26_gg(X1, X2, lesscC_out_gg(X1, X2)) → lesscC_out_gg(s(X1), s(X2))

The set Q consists of the following terms:

leqcB_in_gg(x0, x1)
U25_gg(x0, x1, x2)
lesscC_in_gg(x0, x1)
U26_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(26) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(27) TRUE